<%@ page contentType="text/html; charset=utf-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>后台管理 - 爱购物-商城</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/static/css/style.css"/>
</head>
<body>
<c:import url="/static/page/manager-header-nav.jsp">
    <c:param name="nav" value="user"/>
</c:import>
<div id="position" class="wrap">
    您现在的位置：<a href="${pageContext.request.contextPath}/index">爱购物-商城</a> &gt; 管理后台 &gt; 用户管理
</div>
<div id="main" class="wrap clearfix">
    <c:import url="/static/page/manage-left-nav.jsp"/>
    <div class="main">
        <h2>用户管理</h2>
        <div class="manage">
            <table class="list">
                <tr>
                    <th>ID</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>Email</th>
                    <th>手机</th>
                    <th>操作</th>
                </tr>
                <c:forEach var="u" items="${page.rows}">
                    <tr>
                        <td class="first w2 c">${u.id }</td>
                        <td class="w1 c">${u.username }</td>
                        <td class="w2 c">${u.sex eq "T" ? "男":"女"} </td>
                        <td>${u.email }</td>
                        <td class="w4 c">${u.mobile }</td>
                        <td class="w4 c">
                            <a href="${pageContext.request.contextPath}/manage/user/update?id=${u.id }">修改</a>
                            <c:if test="${u.status==1}">
                                <a href="javascript:deleteUser('${u.id }');">删除</a>
                            </c:if>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
    <c:import url="/static/page/manage-pager.jsp">
        <c:param name="page" value="user"/>
        <c:param name="pageNo" value="${page.pageNo}"/>
        <c:param name="pages" value="${page.pages}"/>
        <c:param name="total" value="${page.total}"/>
    </c:import>
</div>
<c:import url="/static/page/footer.jsp"/>

<script>
    function deleteUser(id) {
        if (confirm("确定要删除该用户么？")) {
            location.href = "${pageContext.request.contextPath}/manage/user/delete?id=" + id;
        }
    }
</script>
</body>
</html>
